/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; display: block; }
button, input, textarea { font: inherit; border: none; outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body { background: #0f172a; color: #e2e8f0; }
    ::-webkit-scrollbar-track { background: #1e293b; }
    ::-webkit-scrollbar-thumb { background: #475569; }
    header { background: linear-gradient(135deg, #0b1a2e 0%, #1a3a5c 50%, #0f2a44 100%) !important; }
    header .banner-overlay { background: rgba(0,0,0,0.4) !important; }
    .card, article, section, details, #howto, footer { background: #1e293b !important; color: #e2e8f0 !important; }
    .glass { background: rgba(30,41,59,0.7) !important; backdrop-filter: blur(12px) !important; border-color: rgba(148,163,184,0.15) !important; }
    nav { background: rgba(15,23,42,0.9) !important; }
    nav a, nav button, nav input { color: #e2e8f0 !important; }
    nav input::placeholder { color: #94a3b8; }
    h1, h2, h3 { color: #f1f5f9 !important; }
    .btn-primary { background: #3b82f6 !important; color: #fff !important; }
    .btn-primary:hover { background: #2563eb !important; }
    details summary { color: #cbd5e1; }
    details[open] summary { color: #f1f5f9; }
    footer a { color: #60a5fa; }
}

/* Header / Banner */
header {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #0b1a2e 0%, #1a3a5c 40%, #2563eb 70%, #0f2a44 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    color: #fff;
    overflow: hidden;
    padding: 2rem 1rem;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
header .banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1;
}
header > *:not(nav) { position: relative; z-index: 2; }
header h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
    animation: fadeUp 0.8s ease-out;
}
header p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    max-width: 700px;
    margin: 1.2rem auto 2rem;
    opacity: 0.9;
    animation: fadeUp 0.8s ease-out 0.15s backwards;
}
header .btn-primary {
    display: inline-block;
    background: #fff;
    color: #1a3a5c;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeUp 0.8s ease-out 0.3s backwards;
}
header .btn-primary:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }

/* Navigation */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 0.5rem;
}
nav > a:first-child {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
nav ul {
    display: flex;
    gap: 1.8rem;
    flex-wrap: wrap;
}
nav ul li a {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: #60a5fa;
    transition: width 0.3s;
}
nav ul li a:hover { color: #fff; }
nav ul li a:hover::after { width: 100%; }
nav form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
nav input[type="search"] {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    width: 140px;
    transition: width 0.3s, background 0.3s;
    border: 1px solid rgba(255,255,255,0.15);
}
nav input[type="search"]:focus { width: 200px; background: rgba(255,255,255,0.2); }
nav button[type="submit"] {
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
nav button[type="submit"]:hover { background: #2563eb; }

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
section {
    margin-bottom: 4rem;
    scroll-margin-top: 80px;
}
h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: #0f172a;
    position: relative;
    display: inline-block;
}
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    margin-top: 0.5rem;
}
h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #1e293b;
}

/* Cards & Articles */
.card, article, section > p, #howto, details, footer {
    background: #fff;
    border-radius: 20px;
    padding: 1.8rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1.5rem;
}
article:hover, .card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }

/* Glass effect (applied to certain elements) */
.glass {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* About section */
#about p { margin-bottom: 1.2rem; max-width: 800px; }
#about ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-top: 1.5rem; }
#about ul li {
    background: rgba(59,130,246,0.08);
    padding: 1rem 1.2rem;
    border-radius: 14px;
    font-weight: 500;
    border-left: 4px solid #3b82f6;
}

/* Products & Solutions grid */
#products, #solutions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.8rem;
}
#products h2, #solutions h2 { grid-column: 1 / -1; }
#products article, #solutions article {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
#products article h3, #solutions article h3 { margin-top: 0; }

/* Articles section */
#articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
#articles h2 { grid-column: 1 / -1; }
#articles article {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
#articles time {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
#articles article p { flex: 1; }
#articles article a {
    color: #3b82f6;
    font-weight: 600;
    margin-top: 0.8rem;
    display: inline-block;
    transition: color 0.2s;
}
#articles article a:hover { color: #1d4ed8; text-decoration: underline; }

/* FAQ */
details {
    border-radius: 16px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}
details summary {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1e293b;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
details summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: #3b82f6;
    transition: transform 0.3s;
}
details[open] summary::after { content: '−'; transform: rotate(180deg); }
details p {
    margin-top: 1rem;
    color: #475569;
    line-height: 1.7;
}

/* HowTo */
#howto ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}
#howto ol li {
    list-style: decimal;
    margin-bottom: 0.8rem;
    line-height: 1.7;
}
#howto strong { color: #0f172a; }

/* Contact & Sitemap */
#contact p { margin-bottom: 0.6rem; font-size: 1.05rem; }
#sitemap ul { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; }
#sitemap ul li a { color: #3b82f6; font-weight: 500; transition: color 0.2s; }
#sitemap ul li a:hover { color: #1d4ed8; text-decoration: underline; }

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    border-radius: 20px 20px 0 0;
    font-size: 0.95rem;
    color: #475569;
}
footer p { margin: 0.4rem 0; }
footer a { color: #3b82f6; font-weight: 500; }

/* Scroll animation (fade-up) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 0.6rem 1rem;
        gap: 0.6rem;
    }
    nav ul { gap: 1rem; justify-content: center; }
    nav ul li a { font-size: 0.9rem; }
    nav input[type="search"] { width: 120px; }
    nav input[type="search"]:focus { width: 160px; }
    header { min-height: 70vh; padding: 4rem 1rem 2rem; }
    header h1 { font-size: 2rem; }
    #products, #solutions, #articles {
        grid-template-columns: 1fr;
    }
    main { padding: 1.5rem 1rem; }
    section { margin-bottom: 2.5rem; }
    .card, article, section > p, #howto, details, footer { padding: 1.2rem; }
    #about ul { grid-template-columns: 1fr; }
}

/* Extra small */
@media (max-width: 480px) {
    nav ul { gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
    nav ul li a { font-size: 0.8rem; }
    header h1 { font-size: 1.7rem; }
    header p { font-size: 0.95rem; }
    .btn-primary { padding: 0.7rem 1.8rem; font-size: 1rem; }
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Selection */
::selection { background: #3b82f6; color: #fff; }

/* Focus visible */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print */
@media print {
    nav, header .btn-primary, form { display: none; }
    body { background: #fff; color: #000; }
    header { min-height: auto; padding: 2rem; }
    .card, article, details { box-shadow: none; border: 1px solid #ccc; }
}